package com.piece.core.verifycode.processor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 校验码处理器,封装不同校验码的处理逻辑
 */
public interface ValidateCodeProcessor {

    /**
     * 验证码放入session时的前缀
     */
    String SESSION_KEY_PREFIX = "SESSION_VALIDATE_CODE_KEY ";

    /**
     * 创建校验码
     */
    void create(HttpServletRequest request, HttpServletResponse response) throws Exception;

    /**
     * 校验验证码
     */
    void validate(String token, String code);

    String getSessionKeyPrefix();
}
